﻿using UnityEngine;
using UnityEngine.UI;

namespace Core.Animation {
    public class CPUAnimation : IAnimation {
        private UnityEngine.Animation mAnimation;
        public CPUAnimation(UnityEngine.Animation anim) {
            mAnimation = anim;
        }
        
        public void Play(string animName,bool isLoop) {
            mAnimation.Play(animName);
        }

        public void Stop(string animName) {
            mAnimation.Stop(animName);
        }

        public bool HasClip(string animName) {
            return mAnimation.GetClip(animName) != null;
        }

        public float GetDuration(string animName) {
            return mAnimation.GetClip(animName).length;
        }
    }
}